import { Routes } from '@angular/router';
import { UserComponent } from '../components/UserComponent/app.usercomponent';
import { AppComponent } from '../app.component';
import { NotFoundComponent } from '../components/NotFound/NotFound';
import { LoginGuard } from './login.guard';
import { UnsaveGuard } from './logout.guard';

export const ROUTES: Routes = [
  { path: '', component: AppComponent },
  { path: 'user', component: UserComponent, canActivate: [LoginGuard], canDeactivate: [UnsaveGuard] }, // 路由守卫
  { path: '**', component: NotFoundComponent }
];
